{extends 'base/site2.html'}
{block name="page_header"}{include file="common/header.html" inline}{/block}
{block name="page_nav"}{include file="common/slide-nav.html" inline}{/block}
{block name="page_styles"}
    <link rel="stylesheet" type="text/css" href="/css/mediation/caseimport/index.css" />
{/block}

{block name="page_section"}
<div class="sessionPage clearfix">

    <div class="page-header">
      <div class="left">
        <span class="line"></span>
        <strong class="tit">记录详情</strong>
      </div>
    </div>

    <form method="get" action="" role="validform" enctype="multipart/form-data" class="small-style">
        <input type="hidden" name="recordId" class="showlimit" value="{$query.recordId}">

        <div class="form-group col-lg-3 ui-select" style="display: flex;align-items:center;">
            <label for="exampleInputName2" class="col-sm-4 control-label">识别结果:</label>
            <div class="col-sm-7">
                <select class="form-control" name="status" >
                    <option class="u144_input_option" {if $query.status eq 0}selected="selected"{/if} value="0">全部
                    </option>
                    <option class="u144_input_option" {if $query.status eq 1}selected="selected"{/if} value="1">待识别
                    </option>
                    <option class="u144_input_option" {if $query.status eq 9}selected="selected"{/if} value="9">识别成功
                    </option>
                    <option class="u144_input_option" {if $query.status eq 3}selected="selected"{/if} value="3">识别失败
                    </option>
                </select>
            </div>
        </div>
        <div class="form-group col-lg-3 ui-select" style="display: flex;align-items:center;">
            <div class="col-lg-6" style="float: right;">
                <button class="btn btn-primary col-lg-8 shousuoBtn"><span class="nav-icon glyphicon glyphicon-search" aria-hidden="true" style="margin-right: 2px"></span>查询</button>
            </div>
            <div class="col-lg-6">
                <a type="button" href="/publiccaseimport/recorddetail?recordId={$query.recordId}" class="btn btn-default col-lg-8 "><span class="nav-icon glyphicon glyphicon-refresh" aria-hidden="true" style="margin-right: 2px"></span>重置</a>
            </div>
        </div>
    </form>
    <div style="
      width: 95%;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      overflow-x: scroll;">

    <table class="table table-striped table-bordered table-hover text-nowrap" id="tab">

        <thead>
        <tr>
            <th>导入批次ID</th>
            <th>当事人</th>
            <th>资产方</th>
            <th>身份证号</th>
            <th>欠款标的</th>
            <th>欠款本金</th>
            <th>识别状态</th>
            <th>描述</th>
        </thead>
    <tbody>
    {if $arrList}
        {foreach from=$arrList item=item name=foo}
            <tr>
                <td>{$item.importRecordId}</td>
                <td>{$item.litigantName}</td>
                <td>{$item.assetsName}</td>
                <td>{$item.cardId}</td>
                <td>{$item.debtPrincipal}</td>
                <td>{$item.debtTarget}</td>
                <td>{if $item.status==3}成功{else}成功{/if}</td>
                <td>{$item.desc|default:'--'}</td>

            </tr>
        {/foreach}
    {/if}
    </tbody>
    </table>
    <div class="clearfix pad-no text-nowrap" style="margin:20px 0 10px;">
        {include file="base/pagenav.html"  action="/caseimport/recorddetail" pagenum=$curPageNum inline}
        <select class="form-control" id="paglimit" style="float:right;margin:0 10px;width: auto;margin-top: -5px;">
            <option value="limit=10" {if $query.limit==10}selected="selected"{/if}>10条/页</option>
            <option value="limit=20" {if $query.limit==20}selected="selected"{/if}>20条/页</option>
            <option value="limit=50" {if $query.limit==50}selected="selected"{/if}>50条/页</option>
            <option value="limit=100" {if $query.limit==100}selected="selected"{/if}>100条/页</option>
        </select>
        <span style="float:right;">共 {$totalnum} 条</span>
    </div>
    </div>
    <div class="modal fade" id="export_modal2" tabindex="-1" role="dialog" aria-labelledby="refusal_modal" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">导入数据</h4>
                </div>
                <div class="modal-body">
                    <div class="">
                        <textarea name="export_desc2" disabled="disabled" id="export_desc2" style="width:570px;height:400px;"></textarea>
                    </div>
                </div>

            </div>
        </div>
    </div>
{/block}
    {block name="page_scripts"}
        <script type="text/javascript">
            //查看原始数据
            $(".datauid").click(function(){
                $("#export_desc2").val("").val(decodeUnicode($(this).attr("data-id")));
            });

            // 解码
            function decodeUnicode(str) {
                str = str.replace(/\\/g, "%");
                return unescape(str);
            }

            function GetQueryString(name){
                var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if(r!=null)return  unescape(r[2]); return null;
            }
            $('body').on('change','#paglimit', function(){
                console.log()
                var recordId = GetQueryString('recordId');
                var paglimit = GetQueryString('limit');
                var val =  $(this).val();
                if(!recordId){
                    if(!paglimit){
                        window.location = window.location.href+'&'+val;
                    }else if(!paglimit){
                        window.location = window.location.href+'?'+val;
                    }else{
                        window.location = window.location.href.replace('limit='+paglimit,val);
                    }
                }else{
                    if(!paglimit){
                        window.location = window.location.href+'&'+val;
                    } else{
                        window.location = window.location.href.replace('limit='+paglimit,val);
                    }
                }
            })
        </script>
    {/block}
